package me.cloudcat.develop.service.configuration;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import me.cloudcat.develop.dao.configuration.MenuDao;
import me.cloudcat.develop.entity.configuration.Menu;

@Service
@Transactional(readOnly=true)
public class MenuService {
	
	@Autowired
	MenuDao menuDao;
	
	public Menu findOne(Long id){
		Menu findOne = menuDao.findOne(id);
		return findOne;
	}
	
	public List<Menu> findAll(){
		 List<Menu> findAll = menuDao.findAll();
		 return findAll;
	}
	
	@Transactional(readOnly=false)
	public void save(Menu entity){
		menuDao.save(entity);
	}
	
}
